<?php
namespace Product\Model\Entity;

class Product
{
    public $id;
	public $name;
    public $description;
    public $quantity;
    public $type;
    public $pricefrequency;
    public $ownedsecurableitem_id;
    public $account_id;
    public $contact_id;
    public $opportunity_id;
    public $producttemplate_id;
    public $stage_customfield_id;
    public $sellprice_currencyvalue_id;

    public function exchangeArray($data)
    {
        $this->id     = (isset($data['id'])) ? $data['id'] : null;
        $this->name = (isset($data['name'])) ? $data['name'] : null;
        $this->description  = (isset($data['description'])) ? $data['description'] : null;
		$this->quantity  = (isset($data['quantity'])) ? $data['quantity'] : null;
		$this->type  = (isset($data['type'])) ? $data['type'] : null;
		$this->pricefrequency  = (isset($data['pricefrequency'])) ? $data['pricefrequency'] : null;
		$this->ownedsecurableitem_id  = (isset($data['ownedsecurableitem_id'])) ? $data['ownedsecurableitem_id'] : null;
		$this->account_id  = (isset($data['account_id'])) ? $data['account_id'] : null;
		$this->contact_id  = (isset($data['contact_id'])) ? $data['contact_id'] : null;
		$this->opportunity_id  = (isset($data['opportunity_id'])) ? $data['opportunity_id'] : null;
		$this->producttemplate_id  = (isset($data['producttemplate_id'])) ? $data['producttemplate_id'] : null;
		$this->stage_customfield_id  = (isset($data['stage_customfield_id'])) ? $data['stage_customfield_id'] : null;
		$this->sellprice_currencyvalue_id  = (isset($data['sellprice_currencyvalue_id'])) ? $data['sellprice_currencyvalue_id'] : null;	
    }
    public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    /*
	public function __set($name, $value) {
        $method = 'set' . $name;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Method');
        }
        $this->$method($value);
    }

    public function __get($name) {
        $method = 'get' . $name;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Method');
        }
        return $this->$method();
    }

    public function setOptions(array $options) {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }*/

    public function getId() {
        return $this->_id;
    }

    public function setId($id) {
        $this->_id = $id;
        return $this;
    }

    public function getName() {
        return $this->_name;
    }

    public function setName($name) {
        $this->_name = $name;
        return $this;
    }

    public function getDescription() {
        return $this->_description;
    }

    public function setDescription($description) {
        $this->_description = $description;
        return $this;
    }
	public function getQuantity() {
        return $this->_quantity;
    }

    public function setQuantity($quantity) {
        $this->_quantity = $quantity;
        return $this;
    }
    public function getType() {
        return $this->_type;
    }

    public function setType($type) {
        $this->_type = $type;
        return $this;
    }
	public function getPrice() {
        return $this->_pricefrequency;
    }

    public function setPrice($pricefrequency) {
        $this->_pricefrequency = $pricefrequency;
        return $this;
    }
	public function getOwned() {
        return $this->_ownedsecurableitem_id;
    }

    public function setOwned($ownedsecurableitem_id) {
        $this->_ownedsecurableitem_id = $ownedsecurableitem_id;
        return $this;
    }
	public function getAccount() {
        return $this->_account_id;
    }

    public function setAccount($account_id) {
        $this->_account_id = $account_id;
        return $this;
	}
	  public function getContact() {
        return $this->_contact_id;
    }

    public function setContact($contact_id) {
        $this->_contact_id = $contact_id;
        return $this;
	}
	public function getOpportunity() {
        return $this->_opportunity_id;
    }

    public function setOpportunity($opportunity_id) {
        $this->_opportunity_id = $opportunity_id;
        return $this;
    }
	public function getProduct() {
        return $this->_producttemplate_id;
    }

    public function setProduct($producttemplate_id) {
        $this->_producttemplate_id = $producttemplate_id;
        return $this;
    }
	public function getStage() {
        return $this->_stage_customfield_id;
    }

    public function setStage($stage_customfield_id) {
        $this->_stage_customfield_id = $stage_customfield_id;
        return $this;
    }
	public function getSellprice() {
        return $this->_sellprice_currencyvalue_id;
    }

    public function setSellprice($sellprice_currencyvalue_id) {
        $this->_sellprice_currencyvalue_id = $sellprice_currencyvalue_id;
        return $this;
    }
}
?>